package com.example.demo;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.stereotype.Component;

/**
 * @author lizhien (zhien.li@nascent.cn)
 * @version 1.0.0
 * @date 2022/3/18 16:02
 * @description com.example.demo
 */

@Component
public class HttpConterHelper {

    public Counter counter;

    public HttpConterHelper(MeterRegistry registry) {
        this.counter = registry.counter("custom_api_http_requests_total");
    }

    public void count() {
        this.counter.increment();
    }

}
